const response = {
    success: (ctx, { message = 'success', data = null, status = 200 }) => {
        console.log(message, 'message')
        ctx.status = status;
        ctx.body = {
            code: status,
            message: message,
            data: data
        };
        // 添加日志记录
        console.log(`[Response] ${ctx.method} ${ctx.path} -> ${status} ${message}`);
    },
    error: (ctx, { message = 'error', status = 201 }) => {
        ctx.status = status;
        ctx.body = {
            code: status,
            message: message,
        };
        // 添加日志记录
        console.log(`[Response] ${ctx.method} ${ctx.path} -> ${status} ${message}`);
    }
}
module.exports = response
